-
Notifications
You must be signed in to change notification settings - Fork 4k
Update email.mdx #12969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update email.mdx #12969
Conversation
Added logic for express and react
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@drleavio is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
<Code.ExpressClient> | ||
```tsx filename="Login.tsx" | ||
import { useState } from 'react'; | ||
import axios from 'axios'; | ||
|
||
const Login = () => { | ||
const [email, setEmail] = useState(''); | ||
const [message, setMessage] = useState(''); | ||
|
||
const handleSendLink = async () => { | ||
try { | ||
const res = await axios.post('/auth/login', { email }); | ||
setMessage(res.data.message); | ||
} catch (err: any) { | ||
setMessage(err.response?.data?.error || 'Error sending link'); | ||
} | ||
}; | ||
|
||
return ( | ||
<div> | ||
<h2>Login with Magic Link</h2> | ||
<input | ||
type="email" | ||
placeholder="Enter your email" | ||
value={email} | ||
onChange={(e) => setEmail(e.target.value)} | ||
/> | ||
<button onClick={handleSendLink}>Send Magic Link</button> | ||
<p>{message}</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Login; | ||
``` | ||
</Code.ExpressClient> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ExpressClient tab hasn’t been set yet. Tabs are managed by the main maintainers and are typically added when documentation reflects new framework support in auth.js, or when previously disabled tabs are reactivated.
For reference, you can check how tabs are handled here:
next-auth/docs/components/Code/index.tsx
Lines 13 to 37 in 39dd3b9
Code.Next = NextCode | |
Code.NextClient = NextClientCode | |
Code.Svelte = SvelteCode | |
// Code.Solid = SolidCode; | |
Code.Express = ExpressCode | |
Code.Qwik = QwikCode | |
const baseFrameworks = { | |
[NextCode.name]: "Next.js", | |
[QwikCode.name]: "Qwik", | |
[SvelteCode.name]: "SvelteKit", | |
[ExpressCode.name]: "Express", | |
// [SolidCode.name]: "SolidStart", | |
} | |
const allFrameworks = { | |
[NextCode.name]: "Next.js", | |
[NextClientCode.name]: "Next.js (Client)", | |
[QwikCode.name]: "Qwik", | |
[SvelteCode.name]: "SvelteKit", | |
// [SolidCode.name]: "SolidStart", | |
[ExpressCode.name]: "Express", | |
} | |
In the meantime, please move the code currently under the ExpressClient tab into the existing Express tab, and mention its usage within a React app context.
Added logic for express and react
☕️ Reasoning
🧢 Checklist
🎫 Affected issues
📌 Resources